import random
rand = random.randint(1,100)
nu = 0
while  True:
    age = int(input("输入你猜的数字:"))
    if age != rand and nu < 10:
        if age > rand:
            print("你猜大了！")
            nu += 1
            continue
        elif age < rand:
            print("你猜小了！")
            nu += 1
            continue
    elif age == rand:
        print("恭喜，猜对.你用了{}次".format(nu))
        if nu > 6 :
            print("你是悟空")
        elif nu <= 6:
            print("你是沙僧")
        else:
            print("你是师傅")
        break
    else:
        print("已经没了机会。")
        break
